package by.bsuir.sn.model
{
	import mx.collections.ArrayCollection;

	[Bindable]
	public class MainModel
	{
		private static var _inst : MainModel;

		private var _allTables : ArrayCollection;
		private var _currentTable : ArrayCollection;
		private var _executing : Boolean = false;
		private var _currentCreatedItem : Object;
		private var _currentTableIndex : int;

		public function get currentTable() : ArrayCollection
		{
			return _currentTable;
		}

		public function set currentTable(value : ArrayCollection) : void
		{
			_currentTable = value;
		}

		public function get allTables() : ArrayCollection
		{
			return _allTables;
		}

		public function set allTables(value : ArrayCollection) : void
		{
			_allTables = value;
		}

		public function MainModel(lock : SingletonLock)
		{
		}

		public static function get inst() : MainModel
		{
			if(!_inst)
				_inst = new MainModel(new SingletonLock());
			return _inst;
		}

		public function get executing() : Boolean
		{
			return _executing;
		}

		public function set executing(value : Boolean) : void
		{
			_executing = value;
		}

		public function get currentCreatedItem() : Object
		{
			return _currentCreatedItem;
		}

		public function set currentCreatedItem(value : Object) : void
		{
			_currentCreatedItem = value;
		}

		public function get currentTableIndex() : int
		{
			return _currentTableIndex;
		}

		public function set currentTableIndex(value : int) : void
		{
			_currentTableIndex = value;
		}
	}
}

class SingletonLock
{

}
